package liczba;
import junit.framework.*;

public class LiczbaTest extends TestCase {
	
	Liczba example = null;
	
	public void setUp() throws Exception {
		super.setUp();
		example = new Liczba(1);
	}

	public void test2toBinary() throws Exception {
		example.setNumb(2);
		assertEquals(example.toBase(2),"10");
	}
	
	public void test17toHex() throws Exception {
		example.setNumb(10);
		assertEquals(example.toBase(16), "a");
	}
	public void testMinus7to6() throws Exception {
		try {
		example.setNumb(-5);
		fail("There should be exception");
		}
		catch(Exception e) {}
	}
	public void test7toMinus6() throws Exception {
		try {
		example.toBase(-7);
		fail("There should be given Exception");
		}
		catch(Exception e) {}
		
	}
	public void test15to14() throws Exception {
		example.setNumb(15);
		assertEquals(example.toBase(14),"11");
	}
	public void test13to14() throws Exception {
		example.setNumb(13);
		assertTrue(example.toBase(14).equals("d"));
	}	
	public void test14to13() throws Exception {
		example.setNumb(14);
		assertFalse(example.toBase(13).equals("d"));
	}
	public void test15to13() throws Exception {
		example.setNumb(15);
		example.toBase(13);
		assertNotNull(example.numb);
	}
		
	public void tearDown() throws Exception {
		super.tearDown();
		example = null;
	}
//;)
}
